# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=cminer
pkgver=25.d766f7e
pkgrel=1
pkgdesc='A tool for enumerating the code caves in PE files.'
url='https://github.com/EgeBalci/Cminer/'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-binary' 'blackarch-windows')
license=('MIT')
depends=('glibc')
makedepends=('git')
source=("$pkgname::git+https://github.com/EgeBalci/Cminer.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd "$pkgname/src"

  g++ Cminer.cpp -o $pkgname
}

package() {
  cd $pkgname

  install -Dm 755 "src/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

